import { Entity, Column, PrimaryGeneratedColumn, ManyToOne } from 'typeorm';
import { Classroom } from './classroom.entity';

@Entity()
export class Student {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ type: 'varchar', length: 20, unique: true })
  student_id: string;

  @Column({ type: 'varchar', length: 20})
  class_id: string;

  @Column()
  name: string;

  @ManyToOne(() => Classroom, classroom => classroom.students)
  classroom: Classroom;
}